package pl.nazaweb.imedproplus.rest.pojo;

import java.math.BigInteger;
import pl.nazaweb.imedproplus.model.entity.OrganizationStructure;

public class OrganizationStructurePojo {

    public Long id;
    public String code;
    public String type;
    public String name;
    public String nfzCode;
    public int status;
    public String departmentCodePart3;
    public String departmentCodePart6;
    public String departmentCodePart5;
    public String departmentCodePart7;
    public String departmentCodePart8;
    public BigInteger parent;
    public BigInteger child;
    public boolean hasChild;

    public OrganizationStructurePojo() {
    }

    public OrganizationStructurePojo(OrganizationStructure org) {
        this.id = org.getId();
        this.code = org.getCode();
        this.type = org.getType();
        this.name = org.getName();
        this.nfzCode = org.getNfzCode();
        this.status = org.getStatus();
        this.departmentCodePart3 = org.getDepartmentCodePart3();
        this.departmentCodePart6 = org.getDepartmentCodePart6();
        this.departmentCodePart5 = org.getDepartmentCodePart5();
        this.departmentCodePart7 = org.getDepartmentCodePart7();
        this.departmentCodePart8 = org.getDepartmentCodePart8();
        this.parent = org.getParent();
        this.hasChild = org.getHasChild();
    }
    
    public OrganizationStructure getEntity(){
        OrganizationStructure entity = new OrganizationStructure();
        entity.setId(id);
        entity.setCode(code);
        entity.setType(type);
        entity.setName(name);
        entity.setNfzCode(nfzCode);
        entity.setStatus(status);
        entity.setDepartmentCodePart3(departmentCodePart3);
        entity.setDepartmentCodePart5(departmentCodePart5);
        entity.setDepartmentCodePart6(departmentCodePart6);
        entity.setDepartmentCodePart7(departmentCodePart7);
        entity.setDepartmentCodePart8(departmentCodePart8);
        entity.setParent(parent);
        entity.setHasChild(hasChild);
        return entity;
    }
}
